package com.itheima.hashtable;

import java.util.concurrent.ConcurrentHashMap;

public class HashMap {
    public static void main(String[] args) throws InterruptedException {
        ConcurrentHashMap<String,String> map = new ConcurrentHashMap<>();

        new Thread(()->{
            for (int i = 0; i < 25; i++) {
                map.put(i+"",i+"");
            }
        }).start();

        new Thread(()->{
            for (int i = 25; i < 51; i++) {
                map.put(i+"",i+"");
            }
        }).start();

        Thread.sleep(1000);

        for (int i = 0; i < 51; i++) {
            String s = map.get(i+"");
            System.out.println(s);
        }
    }
}
